<template>
  <el-table
    :data="sortList"
    @selection-change="handleSelection"
    :stripe="true"
  >
    <el-table-column type="selection" width="55" align="center" />
    <el-table-column label="编号" align="center" prop="index" />
    <el-table-column label="分类名称" align="left" prop="sortName" show-overflow-tooltip/>
    <!--    暂无字段      -->
    <el-table-column label="分类描述" align="left" prop="sortName" show-overflow-tooltip/>

    <el-table-column label="主表名称" align="left" prop="sortMainTableName" show-overflow-tooltip>
      <template slot-scope="scope">
        {{scope.row.sortMainTableName? scope.row.sortMainTableName : '-'}}
      </template>
    </el-table-column>
    <el-table-column label="子表名称" align="left" prop="sortSublistName" show-overflow-tooltip>
      <template slot-scope="scope">
        {{scope.row.sortSublistName? scope.row.sortSublistName : '-'}}
      </template>
    </el-table-column>
    <el-table-column label="展示表名称" align="left" prop="sortViewTableName" show-overflow-tooltip>
      <template slot-scope="scope">
        {{scope.row.sortViewTableName? scope.row.sortViewTableName : '-'}}
      </template>
    </el-table-column>
    <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
      <template slot-scope="scope">
        <el-button
          size="mini"
          type="text"
          icon="el-icon-edit"
          @click="handleUpdated(scope.row)"
          v-hasPermi="['system:sort:edit']"
        >修改</el-button>
        <el-button
          size="mini"
          type="text"
          icon="el-icon-delete"
          @click="handleDeleted(scope.row)"
          v-hasPermi="['system:sort:remove']"
        >删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  name: 'commonTables',
  props:["sortList","handleSelectionChange","handleUpdate","handleField","handleDelete"],
  methods: {
    handleSelection(selection) {
      this.handleSelectionChange(selection)
    },
    handleUpdated(row) {
      this.handleUpdate(row)
    },
    handleFieldEvent(row) {
      this.handleField(row)
    },
    handleDeleted(row) {
      this.handleDelete(row)
    }
  }
}
</script>

<style scoped>

</style>
